1. Technical Field
The present subject matter relates generally to processors and more particularly to an instruction that executed on a processor and that determines whether an array access (e.g., an array load or an array store) improperly targets a location outside the array.
2. Background Information
The execution of some types of programming languages, such as Java™, preclude accessing an array with an index value that points to an element that lies outside the boundary of the array. An access may comprise an array store or an array load operation. An array store instruction attempts to store a value at a certain location within a target array. The location within the array is defined by an index value included as part of the store or load instruction. An array load attempts to retrieve a value from a certain location (specified by an index) within the array.
If the index value corresponds to a location outside the boundaries of the array, an error results and an exception is “thrown” meaning that program flow is interrupted and control jumps to an exception handler to address this anomalous behavior. Multiple checks for boundary violations must be performed. Such checks slow down the performance of the executing code.